local pch_mm = pch_mm or {}

-- pch_mm.appInfo = {
-- 	appId = "300008713232",
-- 	appKey = "6C20462E58C13D91BF463E98317A4F9D"
-- }

pch_mm.itemInfo = {
    ChangWanLiBao = { paycode = "30000871323201"},
    TiLiBuMan = 	{ paycode = "30000871323202"},
    FuHuo = 		{ paycode = "30000871323203"},
    JinBi_680 = 	{ paycode = "30000871323204"},
    JinBi_1680 = 	{ paycode = "30000871323205"},
    JinBi_3980 = 	{ paycode = "30000871323206"},
    FenJi_10 = 		{ paycode = "30000871323207"},
    YuHeng_10 = 	{ paycode = "30000871323208"},
}

local luaj = require "luaj"

function pch_mm:init_callJava()
	local args = {}
	local sigs = "()V"
	local className = "org/cocos2dx/lua/AppActivity"
	local ok = luaj.callStaticMethod(className, "s_mmInit_fromLua", args, sigs)
	if not ok then
		d_print("pch_mm init_callJava error")
	end
end

function pch_mm:order_callJava( item )
	-- body
	if self.itemInfo[item.key] then
		
        local paycode = self.itemInfo[item.key].paycode

		local args = {paycode,item.desc}
		local sigs = "(Ljava/lang/String;Ljava/lang/String;)V"
		local className = "org/cocos2dx/lua/AppActivity"
		local ok = luaj.callStaticMethod(className, "s_mmOrder_fromLua", args, sigs)

		if not ok then
			d_print("pch_mm order_callJava error")
		end

	else
        assert(false, "mm order item unexist:"..item.key)
	end
		
end


return pch_mm
